const { ref } = Vue
import { useFetch } from '../../../Scripts/hooks/useFetch.js'

export function useWorkTime() {
  let worktime = ref('0');//员工工时

  const getWorkerWorkTime = async configObj => {
    const { data } = await useFetch({
      url: `${configObj.url}?actions=${configObj.method}`,
      data: {
        type: `${configObj.method}`,
        employeeid: configObj.employeeid,
        day: configObj.day
      }
    });
    worktime.value = data.value;
  };

  return { worktime, getWorkerWorkTime };
}